package com.bw.goods.mvvm.adapter;

import android.widget.ImageView;

import com.bw.goods.R;
import com.bw.goods.mvvm.model.entity.HomeGoodsEntity;
import com.bw.mvvm_common.network.load.LoadImage;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class HomeGoodsAdapter extends BaseQuickAdapter<HomeGoodsEntity.DataBean, BaseViewHolder> {
    public HomeGoodsAdapter() {
        super(R.layout.item_home_goods);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, HomeGoodsEntity.DataBean dataBean) {
        ImageView img = baseViewHolder.findView(R.id.mGoodsDetailItemIv);
        baseViewHolder.setText(R.id.mGoodsDetailItemPriceTv,""+dataBean.getGoods_default_price());
        baseViewHolder.setText(R.id.mGoodsDetailItemTitleTv,""+dataBean.getGoods_default_sku());
        LoadImage.loadMatchImg(dataBean.getGoods_default_icon(),img);
    }
}
